What optimization pass promotes 32 bit math operations to 64 bit operations so I can disable it? I have code that works fine with optimizations turned off but fails with it turned on because of this stage. Micah Villmow Systems Engineer Advanced Technology & Performance Advanced Micro Devices Inc. 4555 Great America Pkwy, Santa Clara, CA. 95054 P: 408-572-6219 F: 408-572-6596 -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20081204/97fe5239/attachment.html>
On Dec 4, 2008, at 8:58 AM, Villmow, Micah wrote:> What optimization pass promotes 32 bit math operations to 64 bit > operations so I can disable it? I have code that works fine with > optimizations turned off but fails with it turned on because of this > stage. >Do you have a testcase? An .ll file with no 64-bit operations, and one optimization pass that introduces them? -Chris -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20081204/f7b20800/attachment.html>
On Thu, Dec 4, 2008 at 7:08 PM, Chris Lattner <clattner at apple.com> wrote:> > On Dec 4, 2008, at 8:58 AM, Villmow, Micah wrote: > > What optimization pass promotes 32 bit math operations to 64 bit operations > so I can disable it? I have code that works fine with optimizations turned > off but fails with it turned on because of this stage. > > > Do you have a testcase? An .ll file with no 64-bit operations, and one > optimization pass that introduces them?Sounds a lot like the issue I reported in PR 3101. Can you run your bitcode through opt -instcombine and check for promotions? Greetings, Tilmann
I've attached the original ll file and the result of doing llvm-as < test_fc_27.ll | opt -std-compile-opts > test_fc_27-opt.bc llvm-dis test_fc_27-opt.bc This is very problematic as 64 bit integer operations are software emulated and I would rather not have them generated unless explicitly requested by the programmer. ________________________________ From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] On Behalf Of Chris Lattner Sent: Thursday, December 04, 2008 10:08 AM To: LLVM Developers Mailing List Subject: Re: [LLVMdev] 32bit math being promoted to 64 bit On Dec 4, 2008, at 8:58 AM, Villmow, Micah wrote: What optimization pass promotes 32 bit math operations to 64 bit operations so I can disable it? I have code that works fine with optimizations turned off but fails with it turned on because of this stage. Do you have a testcase? An .ll file with no 64-bit operations, and one optimization pass that introduces them? -Chris -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20081204/fbb41292/attachment.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: test_fc_27.ll Type: application/octet-stream Size: 2450 bytes Desc: test_fc_27.ll URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20081204/fbb41292/attachment.obj> -------------- next part -------------- A non-text attachment was scrubbed... Name: test_fc_27-opt.ll Type: application/octet-stream Size: 1689 bytes Desc: test_fc_27-opt.ll URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20081204/fbb41292/attachment-0001.obj>
> Do you have a testcase? An .ll file with no 64-bit operations, and one > optimization pass that introduces them?It's pretty common to instcombine to expand 32 bit operations to 64 bit. See, for example, recent issue with CellSPU's 32 =>64 bit muls -- With best regards, Anton Korobeynikov Faculty of Mathematics and Mechanics, Saint Petersburg State University
Apparently Analagous Threads
- [LLVMdev] Proposal: Debug information improvement - keep the line number with optimizations
- [LLVMdev] Compiling Linux Kernel
- [LLVMdev] Reproducing output of llvm-gcc using opt tool
- [LLVMdev] Reproducing output of llvm-gcc using opt tool
- [LLVMdev] 32bit math being promoted to 64 bit