1. 06 Jul, 2000 2 commits
    • simonpj's avatar
      [project @ 2000-07-06 16:31:45 by simonpj] · 525898a9
      simonpj authored
      * Improve the warning "M is imported but nothing from it is used"
        In particular, don't warn if some instances from it are imported.
      
        It's pretty much impossible to do the Right Thing always.
        A comment in Rename.lhs says
      	-- NOTE: Consider
      	--	      module This
      	--		import M ()
      	--
      	--	 The import M() is not *necessarily* redundant, even if
      	-- 	 we suck in no instance decls from M (e.g. it contains
      	--	 no instance decls, or This contains no code).  It may be
      	--	 that we import M solely to ensure that M's orphan instance
      	--	 decls (or those in its imports) are visible to people who
      	--	 import This.  Sigh.
      	--	 There's really no good way to detect this, so the error message
      	--	 in RnEnv.warnUnusedModules is weakened instead
      
      * Minor comment changes to RnIfaces.lhs
      
      * Use NameEnv instead of UFM in TcEnv (tidy up only)
      525898a9
    • simonmar's avatar
      [project @ 2000-07-06 14:08:31 by simonmar] · 5d42ac16
      simonmar authored
      New form of literal: MachLabel, for addresses of labels.  Used by
      foreign label instead of MachLitLit now.
      
      Real lit-lits now cause the NCG to panic.
      
      Also: removed CLitLit from AbsCSyn; it was only used in one place for
      a purpose it shouldn't have been used for in the first place.
      5d42ac16
  2. 05 Jul, 2000 1 commit
    • sewardj's avatar
      [project @ 2000-07-05 14:28:49 by sewardj] · dfedfb02
      sewardj authored
      Rename the marker used by Diff_Gcc_Nat.hs to ___ncg_debug_marker, to make
      it clear it has nothing to do with the usual object-splitting machinery.
      
      Improve Diff_Gcc_Nat:
      * Emit a warning, and stop, if there are no debug markers in the NCG code.
      * Handle .uahalf and .uaword, which appear in sparc assembly, but not x86.
      dfedfb02
  3. 04 Jul, 2000 1 commit
  4. 03 Jul, 2000 7 commits
  5. 02 Jul, 2000 2 commits
    • panne's avatar
      [project @ 2000-07-02 18:59:10 by panne] · 2a0ffd1c
      panne authored
      Don't use addr2Integer for large integral literals anymore, use a
      Horner schema with numbers in the Int range instead. This improves
      constant folding, so e.g.  (0x87654321 :: Word32) is evaluated at
      compile time now. In theory we can completely say Good-bye to
      addr2Integer, but for the time being it's still there. Feel free to
      nuke it...  >:-)
      2a0ffd1c
    • panne's avatar
      [project @ 2000-07-02 18:50:24 by panne] · d781517f
      panne authored
      Don't warn the user about integer overflow during constant folding
      anymore. It's not done at runtime either, and compilation of
      completely harmless things like
      
         ((124076834 :: Word32) + (2147483647 :: Word32))
      
      yielded a warning.
      d781517f
  6. 30 Jun, 2000 3 commits
    • panne's avatar
      [project @ 2000-06-30 18:38:03 by panne] · a4b4ad24
      panne authored
      Remove parentheses around C function/macros names. This is necessary
      because cpp does *not* replace e.g.
      
         (eqForeignObj)(f1,f2)
      
      with
      
        ((f1)==(f2))
      
      (see PrimOps.h), heaven (or K&R) knows why. OK foreign importing
      macros is a hack, but GHC seems to depend on it.
      a4b4ad24
    • simonpj's avatar
      [project @ 2000-06-30 13:11:07 by simonpj] · b0624daa
      simonpj authored
      In a CCall, a DynamicTarget has a unique that is
      used only to generate a uniquely-named typedef.
      It should not be used when comparing CCalls (e.g.
      when seeing if interface files have changed).
      So the main change in this commit is to fix the Eq
      instance for PrimOp.CCallTarget, but I took the
      opportunity to clean up the CCallTarget interface
      a little.
      b0624daa
    • simonpj's avatar
      [project @ 2000-06-30 13:10:38 by simonpj] · 9282daea
      simonpj authored
      Improve error message
      9282daea
  7. 29 Jun, 2000 2 commits
  8. 28 Jun, 2000 5 commits
  9. 27 Jun, 2000 4 commits
    • lewie's avatar
      [project @ 2000-06-27 16:48:25 by lewie] · 365a3d9d
      lewie authored
      splitFunTy_maybe was making a special case of implicit params by
      returning Nothing on a type `noted' as an implicit param.  It shouldn't
      (my bad).  It's mostly used downstream of the type checker, where we don't
      care so much about the difference between implicit and explicit params.
      The right thing to do is just see thru the NoteTy (i.e. eliminate the
      special case for IPs).
      
      Please merge.
      365a3d9d
    • lewie's avatar
      [project @ 2000-06-27 16:36:00 by lewie] · 74f9d560
      lewie authored
      Cleaned out a handful of unused imports.
      74f9d560
    • rrt's avatar
      [project @ 2000-06-27 13:45:30 by rrt] · 0f1041d2
      rrt authored
      Some initial notes on DLLs.
      
      plsmrg
      0f1041d2
    • lewie's avatar
      [project @ 2000-06-27 09:08:32 by lewie] · 778b2c6b
      lewie authored
      Further refine the test for when to simplify... in particular, was
      generating bogus code when a signature asserted an implicit param,
      but the code didn't use one.
      
      Please Merge.
      778b2c6b
  10. 22 Jun, 2000 3 commits
    • simonpj's avatar
      [project @ 2000-06-22 14:45:41 by simonpj] · 5f352824
      simonpj authored
      *** NO NEED TO MERGE WITH 4.07 ***
          (but it would do no harm)
      
      * Improve an error message when overlapping instance
        declarations are present.  Carl Witty reported this
        infelicitous message.  The problem arises for this code:
      
      	class Foo a
      	class (Foo a) => Bar a
      	
      	data Dat a = Dat
      	
      	instance Foo (Dat a)
      	instance Foo (Dat Integer)
      	
      	instance Bar (Dat a)
      
        The instance decl for Bar should say
      
      	instance Foo (Dat a) => Bar (Dat a) 
      
        because the overlapping instance decls for Foo can't
        be resolved (or at least might vary depending on how
        a is instantiated).
      5f352824
    • simonpj's avatar
      [project @ 2000-06-22 14:41:29 by simonpj] · fad3991b
      simonpj authored
      *** MERGE WITH 4.07 ***
      
      * ParseIface.y should reject newtypes with no
        definition:
      	newtype T a ;
        The rest of the compiler falls over if it sees such a thing.
      fad3991b
    • simonpj's avatar
      [project @ 2000-06-22 14:40:22 by simonpj] · 41cd7a86
      simonpj authored
      *** MERGE WITH 4.07 ***
      
      * The divide by zero check in the constant-folding
        rules was testing the numerator not denominator!
        (For Float and Double.)
      41cd7a86
  11. 20 Jun, 2000 1 commit
    • sewardj's avatar
      [project @ 2000-06-20 15:31:33 by sewardj] · 11c9fdd3
      sewardj authored
      Force binds with coreBindsSize after every simplifier iteration.
      Significantly reduces space use, especially with -O.  This could
      probably be done more cleanly.
      11c9fdd3
  12. 18 Jun, 2000 1 commit
    • simonpj's avatar
      [project @ 2000-06-18 08:37:17 by simonpj] · 91ef36b9
      simonpj authored
      *** MERGE WITH 4.07 ***
      
      * Fix the ambiguity check in TcMonotype.lhs so that
        it is not carried out for types read from interface 
        files.  Some workers may get ambiguous types but that
        does not matter, and should not make compilation fail.
        More detail in the comments with TcMonoType.tc_type_kind
        (the HsForAll case)
      
      * Don't create specialisations for type applications 
        where there's a matching rule.  The rule should
        clearly take precedence.  (Bug reported by Sven.)
        I havn't tested this fix.
      
      * Run the occurrence analyser after tidyCore, so that
        occurrence info (notably dead-var info) is correct
        for the code generators.  This should fix Erik's problem,
        but again I've not tested the fix.  The extra call 
        is in Main.lhs
      
      * Fix CoreToStg so that it can handle an StgLam in mkStgCase.
        This only shows up in a wierd case, documented in 
        CoreToStg.mkStgCase
      91ef36b9
  13. 16 Jun, 2000 2 commits
  14. 15 Jun, 2000 3 commits
    • simonmar's avatar
      [project @ 2000-06-15 11:50:14 by simonmar] · 93c0c44f
      simonmar authored
      urk! the arity of a record selector Id didn't take into account any
      dictionary arguments due to the context on the datatype...
      
      (fixes bug on H/OpenGL reported by Sven)
      93c0c44f
    • sewardj's avatar
      [project @ 2000-06-15 11:17:41 by sewardj] · 0779a545
      sewardj authored
      Emit slightly better x86 floating point code for comparisons, +, -,
      * and /, in the common case where one of the source fake FP regs
      is the same as the destination reg.
      0779a545
    • sewardj's avatar
      [project @ 2000-06-15 08:38:25 by sewardj] · 665229e5
      sewardj authored
      Major thing: new register allocator.  Brief description follows.
      Should correctly handle code with loops in, even though we don't
      generate any such at the moment.  A lot of comments.  The previous
      machinery for spilling is retained, as is the idea of a fast-and-easy
      initial allocation attempt intended to deal with the majority of code
      blocks (about 60% on x86) very cheaply.  Many comments explaining
      in detail how it works :-)
      
      The Stix inliner is now on by default.  Integer code seems to run
      within about 1% of that -fvia-C.  x86 fp code is significantly worse,
      up to about 30% slower, depending on the amount of fp activity.
      
      Minor thing: lazyfication of the top-level NCG plumbing, so that the
      NCG doesn't require any greater residency than compiling to C, just a
      bit more time.  Created lazyThenUs and lazyMapUs for this purpose.
      
      The new allocator is somewhat, although not catastophically, slower
      than the old one.  Fixing of the long-standing NCG space leak more
      than makes up for it; overall hsc run-time is down about 5%, due to
      significantly reduced GC time.
      
      --------------------------------------------------------------------
      
      Instructions are numbered sequentially, starting at zero.
      
      A flow edge (FE) is a pair of insn numbers (MkFE Int Int) denoting
      a possible flow of control from the first insn to the second.
      
      The input to the register allocator is a list of instructions, which
      mention Regs.  A Reg can be a RealReg -- a real machine reg -- or a
      VirtualReg, which carries a unique.  After allocation, all the
      VirtualReg references will have been converted into RealRegs, and
      possibly some spill code will have been inserted.
      
      The heart of the register allocator works in four phases.
      
      1.  (find_flow_edges) Calculate all the FEs for the code list.
          Return them not as a [FE], but implicitly, as a pair of
          Array Int [Int], being the successor and predecessor maps
          for instructions.
      
      2.  (calc_liveness) Returns a FiniteMap FE RegSet.  For each
          FE, indicates the set of registers live on that FE.  Note
          that the set includes both RealRegs and VirtualRegs.  The
          former appear because the code could mention fixed register
          usages, and we need to take them into account from the start.
      
      3.  (calc_live_range_sets) Invert the above mapping, giving a
          FiniteMap Reg FeSet, indicating, for each virtual and real
          reg mentioned in the code, which FEs it is live on.
      
      4.  (calc_vreg_to_rreg_mapping) For virtual reg, try and find
          an allocatable real register for it.  Each real register has
          a "current commitment", indicating the set of FEs it is
          currently live on.  A virtual reg v can be assigned to
          real reg r iff v's live-fe-set does not intersect with r's
          current commitment fe-set.  If the assignment is made,
          v's live-fe-set is union'd into r's current commitment fe-set.
          There is also the minor restriction that v and r must be of
          the same register class (integer or floating).
      
          Once this mapping is established, we simply apply it to the
          input insns, and that's it.
      
          If no suitable real register can be found, the vreg is mapped
          to itself, and we deem allocation to have failed.  The partially
          allocated code is returned.  The higher echelons of the allocator
          (doGeneralAlloc and runRegAlloc) then cooperate to insert spill
          code and re-run allocation, until a successful allocation is found.
      665229e5
  15. 14 Jun, 2000 2 commits
  16. 13 Jun, 2000 1 commit